
<template>
  <v-card :title="title" @submit="submit" @reset="reset">
    <v-form
      :form-title="formTitle"
      :form-data="formData"

    />
  </v-card>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
      default: () => ''
    }
  },
  data() {
    return {
      title: '创建',
      mp_id: '',
      formTitle: [
        {
          en: 'slug',
          cn: '标识'
        },
        {
          en: 'name',
          cn: '名称'
        }
      ],
      formData: {}
    }
  },
  created() {
    const mp_id = this.$route.params.mp_id
    if (mp_id) {
      localStorage.setItem('mp_id', JSON.stringify(mp_id))
    }
    this.mp_id = localStorage.getItem('mp_id')

    this.$emit('childTitle', this.$route.meta.title1)
  },
  methods: {
    submit() {
      const data = this.formData
      this.$post('url', data)
        .then(res => {

        })
    },
    reset() {
      this.formData = {}
    }
  }
}
</script>

<style scoped>

</style>
